#  列表转字符串
lst = ['1','2','3','4','5','6','7','8','9','A','B','C','D','E','F']
str = ",".join(lst)
print(str) # 1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

#  列表添加单个元素
fruits = ['apple', 'banana', 'orange']
fruits.append('pear')
print(fruits) #   ['apple', 'banana', 'orange', 'pear']

#  列表添加多个元素 对原来的列表进行修改
fruits = ['apple', 'banana', 'orange']
print(id(fruits)) #   140596318471488
fruits.extend(['pear', 'kiwi'])
print(id(fruits)) #   140596318471488 地址不变
print(fruits)



# + 合并两个列表
fruits = ['apple', 'banana', 'orange']
print(id(fruits)) #   139729369072960
vegetables = ['tomato', 'cabbage', 'potato']
print(id(vegetables)) # 139729368191936
lst = fruits + vegetables
print(id(lst)) # 139729368191872 生成新的列表
print(lst)